<template>
	<view class="uy-empty">
		<view class="uy-empty-content" :style="`color: ${color}`" v-for="(item,index) in list" :key="index" v-if="item.key == type">
			<view class="uy-icon" :style="{'width': size + 'rpx', 'height': size + 'rpx'}">
				<image style="width: 100%;height: 100%"C src="../../static/logo.png" mode=""></image>
			</view>
			<view :style="{'margin-top': marginTop + 'rpx'}">{{name || ''}}</view>
		</view>
	</view>
</template>

<script>
	export default {
		name:"uni-empty",
		props: {
			type: {
				type: String,
				default: 'null'
			},
			name: {
				type: String,
				default: '暂无数据'
			},
			size: {
				type: [Number || String],
				default: 300
			},
			color: {
				type: String,
				default: '#999999'
			},
			marginTop: {
				type: [Number || String],
				default: 10
			}
		},
		data() {
			return {
				list: [
					{ key: 'null', image: '/static/img/null.png'}
				]
			};
		}
	}
</script>

<style lang="scss" scoped>
	.uy-empty {
		width: 100%;
		padding: 200rpx 0;
	}
	
	.uy-empty-content {
		text-align: center;
	}
	
	.uy-icon {
		margin: auto;
	}
</style>